package cn.gemiman.daoyi.module.cms.dal.mysql.appsitefootprint;

import java.util.*;

import cn.gemiman.daoyi.framework.common.pojo.PageResult;
import cn.gemiman.daoyi.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gemiman.daoyi.framework.mybatis.core.mapper.BaseMapperX;
import cn.gemiman.daoyi.module.cms.dal.dataobject.appsitefootprint.AppSiteFootprintDO;
import org.apache.ibatis.annotations.Mapper;
import cn.gemiman.daoyi.module.cms.controller.admin.appsitefootprint.vo.*;

/**
 * 站点足迹 Mapper
 *
 * @author 道一源码
 */
@Mapper
public interface AppSiteFootprintMapper extends BaseMapperX<AppSiteFootprintDO> {

    default PageResult<AppSiteFootprintDO> selectPage(AppSiteFootprintPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppSiteFootprintDO>()
                .eqIfPresent(AppSiteFootprintDO::getUserType, reqVO.getUserType())
                .eqIfPresent(AppSiteFootprintDO::getUserId, reqVO.getUserId())
                .likeIfPresent(AppSiteFootprintDO::getUserNickname, reqVO.getUserNickname())
                .eqIfPresent(AppSiteFootprintDO::getAppSiteId, reqVO.getAppSiteId())
                .eqIfPresent(AppSiteFootprintDO::getAppId, reqVO.getAppId())
                .eqIfPresent(AppSiteFootprintDO::getCategoryId, reqVO.getCategoryId())
                .eqIfPresent(AppSiteFootprintDO::getArticleId, reqVO.getArticleId())
                .eqIfPresent(AppSiteFootprintDO::getTalkId, reqVO.getTalkId())
                .eqIfPresent(AppSiteFootprintDO::getMessageId, reqVO.getMessageId())
                .eqIfPresent(AppSiteFootprintDO::getCommentId, reqVO.getCommentId())
                .eqIfPresent(AppSiteFootprintDO::getFootprint, reqVO.getFootprint())
                .eqIfPresent(AppSiteFootprintDO::getFootprintFor, reqVO.getFootprintFor())
                .betweenIfPresent(AppSiteFootprintDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppSiteFootprintDO::getId));
    }

}
